﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Text.Json.Serialization;
using System.Threading.Tasks;

namespace Repository.Models {
	public enum EnumSurveyState {
		NotReleased,
		Running,
		Over,
	}
	/// <summary>
	/// 用户做好的问卷模板
	/// </summary>
	[Table("SurveyTmplate")]
	public class Survey {
		[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
		public Guid Id { get; set; }
		public string Name { get; set; } = "SurveyName";
		public string Description { get; set; } = "SurveyDescription";
		public int Reward { get; set; }

		[JsonRequired]
		public Guid? UserId { get; set; }

		public DateTime? CreatedTime { get; set; }
		public EnumSurveyState State { get; set; }
		public int FillNumer { get; set; }
		public ICollection<Question>? Questions { get; set; }
		//public ICollection<ChoiceQ>? ChoiceQs { get; set; }
		//public ICollection<ShortAnswerQ>? ShortAnswerQs { get; set; }
		[JsonIgnore]
		public ICollection<CompletedSurvey>? CompetedSurveys { get; set; }

	}
}
